package spill;

import java.awt.Graphics;
import java.awt.Graphics2D;

public class Background implements Drawable {
	private Item grass;
	private Item sign;
	private double theta;
	
	public Background(Engine en) {
		theta = 25*Math.PI/180;
		grass = new Item("Graphics/GrassC.txt", "Graphics/GrassD.txt", en);
		grass.setCoord(0, 550);
		sign = new Item("Graphics/SignC.txt", "Graphics/SignD.txt", en);
		sign.setCoord(600, 450);
	}
	
	@Override
	public void draw(Graphics g) {
		for (int i = 0; i < 700; i+=14) {
			grass.setX(i);
			grass.draw(g);
		}
		Graphics2D g2d = (Graphics2D) g.create();
		g2d.rotate(theta, sign.getX(), sign.getY());
		sign.draw(g2d);
		g2d.dispose();
	}

	@Override
	public int getX() {
		return 0;
	}

	@Override
	public int getY() {
		return 0;
	}

	@Override
	public void setCoord(int x, int y) {

	}
	

}
